<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('提交审核页面')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-assign">
        <input name="orderIndent" class="form-control" type="hidden" th:value="${orderIndent}">
<!--        审核中-->
        <input name="chkStatus" class="form-control" type="hidden" value="1">
           <div class="form-group">
            <label class="col-sm-2 control-label">部门：</label>
            <div class="col-sm-8">
                <select id="roleName" name="roleName" class="form-control m-b" data-first-title="请选择职位部门">
                    <option value="" >请选择职位部门</option>
                    <option value="市场" >市场部</option>
                    <option value="采购" >采购部</option>
                    <option value="财务" >财务部</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">职位：</label>
            <div class="col-sm-8">
                <select name="role" id="role" class="form-control m-b" data-first-title="请选择职位">
                    <option value="">请选择职位</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">姓名：</label>
            <div class="col-sm-8">
                <select name="sysChkUserId"  id="user" class="form-control m-b" data-first-title="请选择姓名">
                    <option value="">请选择</option>
                </select>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />

<script th:inline="javascript">
    var prefix = ctx + "market/order"
    $("#form-customer-assign").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/assign", $('#form-customer-assign').serialize());
        }
    }
</script>
<script>
    $(function () {
        //查询部门下职位
        $("#roleName").change(function () {
            var pid=$(this).val();
            $.get("/system/role/rolelist?roleName="+pid,'',function (data) {
                var plist="<option value=\"\">请选择职位</option>";
                $(data).each(function (i,e) {
                    plist+="<option value='"+e.roleId+"'>"+e.roleName+"</option>";
                });
                $("#role").html(plist);
            },'json');
        });


        //查询职位下员工
        $("#role").change(function () {
            var pid=$(this).val();
            $.get("/system/user/clist?pid="+pid,'',function (data) {
                var clist=" <option value=\"\">请选择用户</option>";
                $(data).each(function (i,e) {
                    clist+="<option value='"+e.userId+"'>"+e.userName+"</option>";
                });
                $("#user").html(clist);
            },"json");
        });
    });
</script>
</body>
</html>